package euclid;

/**
 * Interface definition: Starter.
 * 
 * @author OpenORB Compiler
 */
public abstract class StarterPOA extends org.omg.PortableServer.Servant
        implements StarterOperations, org.omg.CORBA.portable.InvokeHandler
{
    public Starter _this()
    {
        return StarterHelper.narrow(_this_object());
    }

    public Starter _this(org.omg.CORBA.ORB orb)
    {
        return StarterHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:euclid/Starter:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("endStarter")) {
                return _invoke_endStarter(_is, handler);
        } else if (opName.equals("getName")) {
                return _invoke_getName(_is, handler);
        } else if (opName.equals("getProcess")) {
                return _invoke_getProcess(_is, handler);
        } else if (opName.equals("startProcess")) {
                return _invoke_startProcess(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_getName(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getName();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_startProcess(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();

        startProcess(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getProcess(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();

        euclid.gcdProcess _arg_result = getProcess(arg0_in);

        _output = handler.createReply();
        euclid.gcdProcessHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_endStarter(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        endStarter();

        _output = handler.createReply();

        return _output;
    }

}
